package com.blame.onlinemusicserver.tools;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class BCryptTest {
    public static void main(String[] args) {
        // 你想设置的用户名和密码
        String username = "admin";
        String rawPassword = "123456";

        // 加密密码
        BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
        String encodedPassword = encoder.encode(rawPassword);

        // 输出结果
        System.out.println("加密后的密码: " + encodedPassword);
        System.out.println("\n建议执行的 SQL 语句：");
        System.out.println("INSERT INTO user (username, password) VALUES ('" + username + "', '" + encodedPassword + "');");
    }

}
